﻿using Microsoft.Extensions.DependencyInjection;
using Quartz;
using Quartz.Impl;
using Quartz.Spi;

namespace Sayook.Schedule.Server
{
    public static class QuartzHostServerExtensions
    {

        public static IServiceCollection AddQuartzHostService(this IServiceCollection services)
        {
            services.AddTransient<IJobFactory, JobFactory>();
            services.AddTransient<ISchedulerFactory, StdSchedulerFactory>();
            services.AddHostedService<QuartzHostServer>();
            return services;
        }
    }
}
